package pers.rcklos.myserver.entity;

public class PaperItem {
	
	public static final int VISIBLE_SELF_ONLY	 = 0;		// 仅自己可见
	public static final int VISIBLE_BOTH_ONLY	 = 1;		// 双方可见
	public static final int VISIBLE_PUBLIC		 = 2;		// 公共可见
	public static final int VISIBLE_FIREND_ONLY	 = 3;		// 朋友可见
	
	public static final String[] VISBLE_TO_STRINGS = {"自己可见", "双方可见", "公共可见", "朋友可见"};
	
	private long paperId;						// id
	private long userId;						// 用户id
	private String title;						// 标题
	private String content;						// 内容
	private long numReceiver;					// 接收量
	private long maxReceiver;					// 最大接收量
	private String addr;						// 地址
	private int visible;						// 可见性
	private long numCommend;					// 推荐数
	private long numComment;					// 评论数
	private java.sql.Date createTime;		// 创建时间
	private java.sql.Date modifyTime;		// 修改时间
	
	// bean特有属性
	private String visibleString;
	
	public PaperItem(long paperId, long userId, String title, String content, long numReceiver, long maxReceiver,
			String addr, int visible, long numCommend, long numComment, java.sql.Date createTime, java.sql.Date modifyTime) {
		super();
		this.paperId = paperId;
		this.userId = userId;
		this.title = title;
		this.content = content;
		this.numReceiver = numReceiver;
		this.maxReceiver = maxReceiver;
		this.addr = addr;
		this.visible = visible;
		this.numCommend = numCommend;
		this.numComment = numComment;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
	}
	public PaperItem() {
		super();
	}
	public long getPaperId() {
		return paperId;
	}
	public void setPaperId(long paperId) {
		this.paperId = paperId;
	}
	public long getUserId() {
		return userId;
	}
	public void setUserId(long userId) {
		this.userId = userId;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public long getNumReceiver() {
		return numReceiver;
	}
	public void setNumReceiver(long numReceiver) {
		this.numReceiver = numReceiver;
	}
	public long getMaxReceiver() {
		return maxReceiver;
	}
	public void setMaxReceiver(long maxReceiver) {
		this.maxReceiver = maxReceiver;
	}
	public String getAddr() {
		return addr;
	}
	public void setAddr(String addr) {
		this.addr = addr;
	}
	public int getVisible() {
		return visible;
	}
	public void setVisible(int visible) {
		this.visible = visible;
		setVisibleString(VISBLE_TO_STRINGS[visible]);
	}
	public long getNumCommend() {
		return numCommend;
	}
	public void setNumCommend(long numCommend) {
		this.numCommend = numCommend;
	}
	public long getNumComment() {
		return numComment;
	}
	public void setNumComment(long numComment) {
		this.numComment = numComment;
	}
	public java.sql.Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(java.sql.Date createTime) {
		this.createTime = createTime;
	}
	public java.sql.Date getModifyTime() {
		return modifyTime;
	}
	public void setModifyTime(java.sql.Date modifyTime) {
		this.modifyTime = modifyTime;
	}
	
	public String getVisibleString() {
		return visibleString;
	}
	public void setVisibleString(String visibleString) {
		this.visibleString = visibleString;
	}
	
	@Override
	public String toString() {
		return "PaperItem [paperId=" + paperId + ", userId=" + userId + ", title=" + title + ", content=" + content
				+ ", numReceiver=" + numReceiver + ", maxReceiver=" + maxReceiver + ", addr=" + addr + ", visible="
				+ visibleString + ", numCommend=" + numCommend + ", numComment=" + numComment + ", createTime=" + createTime
				+ ", modifyTime=" + modifyTime + "]";
	}

}
